<?php
header('Content-Type:text/html;charset=utf-8');
require('../public/header.php');
$res3=select2($con,'user','where `id` = '.$_GET['id'])[0];
$where=isset($_GET['id'])?'where `uid` ='. $_GET['id']:'';
$res=select($con,'pinglun',$where);
?>

    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/admin/guanli.php">首页</a><span class="crumb-step">&gt;</span>
            <a class="crumb-name" href="/admin/user/index.php">用户管理</a><span class="crumb-step">&gt;</span>
            <span class="crumb-name">查看评论</span>
            <?php
            echo '<span class="crumb-name">'.$res3['nicheng'].'</span></div>';
            ?>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"></th>
                            <th>ID</th>
                            <th>创建时间</th>
                            <th>内容</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    <?php
                    foreach($res as $k => $v){
                        echo'<tr>';
                            echo'<td class="tc"><input name="id[]" value="59" type="checkbox"></td>';
                            echo"<td>{$v['id']}</td>";
                            echo '<td>';
                            echo date('Y-m-d H:i:s',$v['ctime']);
                            echo "</td>";
                            echo"<td>{$v['content']}</td>";
                            echo '<td>';
                            if($v['zhuangtai']== '1')
                                { echo '显示';
                            }else{
                                echo '不显示';
                            }

                            echo "</td>";
                            echo"<td>
                                <button><a class='link-update' href='/admin/user/delete2.php?id={$v['id']}'>删除评论</a></button>
                            </td>";
                        echo'</tr>';
                    }
                    ?>
                    </table>
                    <div class='list-page'>
                    <button><a href="/admin/user/select2.php?page=1">首页</a></button>
                    <button><a href="/admin/user/select2.php?page=<?php echo $_SESSION['shang'] ?>">上一页</a></button>
                    <button><a href="/admin/user/select2.php?page=<?php echo $_SESSION['xia'] ?>">下一页</a></button>
                    <button><a href="/admin/user/select2.php?page=<?php echo $_SESSION['zongye'] ?>">尾页</a></button>
                    第<?php echo $_SESSION['page'] ?>/<?php echo $_SESSION['zongye'] ?> 页
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
<?php
require('../public/footer.php');